package com.twu.biblioteca;

public class Customer {
    private final String name;
    private final String libNumber;
    private String password;
    private String phoneNumber;
    private String email;

    public Customer(String name, String libNumber) {
        this.name = name;
        this.libNumber = libNumber;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public boolean equals(Object obj) {
        Customer other = (Customer) obj;
        if (other == null || !this.getClass().equals(other.getClass())) return false;
        if (this.name.equals(other.name) && this.libNumber == other.libNumber && this.password.equals(other.password)) {
            return true;
        }
        return false;
    }

    public String libNumber() {
        return libNumber;
    }

    public String password() {
        return password;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String userDetails() {
        return name + LibraryConstants.NEW_LINE + phoneNumber + LibraryConstants.NEW_LINE + email + LibraryConstants.NEW_LINE + libNumber;
    }
}
